{% extends "posts/show/post.html" %}
{% load static %}
{% load posts %}
{% load text_filters %}

{# this type is inherited from "post" #}
{% block post_header %}
    <header class="post-header">
        <div class="post-title p-name">
            Проект: <a href="{{ post.url }}" target="_blank" rel="noopener">{{ post.title | rutypography }}</a>
            <span class="post-publicity-preferences">
                {% include "posts/widgets/publicity_preferences.html" with post=post %}
            </span>
        </div>
        <div class="post-data">
            {% if post.deleted_at %}
                <div class="post-label">
                    <span class="label label-type-deleted">
                        <span class="label-title">Удалённый пост</span>
                    </span>
                </div>
            {% elif post.visibility == "draft" %}
                <div class="post-label">
                    {% include "posts/widgets/draft_label.html" %}
                </div>
            {% endif %}

            {% if post.label %}
                <div class="post-label">
                    {% include "posts/widgets/label.html" with label=post.label %}
                </div>
            {% endif %}

            <div class="post-actions-line">
                {% include "posts/widgets/post_actions_line.html" %}
            </div>

            {% if post.metadata.badges %}
                <a class="post-badges post-badges-center" href="{% url "profile_badges" post.author.slug %}">
                    {% include "badges/widgets/badges.html" with badges=post.metadata.badges %}
                </a>
            {% endif %}

            {% if post.image %}
                <div class="post-project-image block">
                    <div class="post-image">
                        <a href="{{ post.url }}" target="_blank" rel="noopener">
                            <img src="{{ post.image }}" alt="{{ post.title }}">
                        </a>
                    </div>
                    <div class="post-project-link">
                        <a href="{{ post.url }}" target="_blank" rel="noopener">{{ post.url }}</a>
                    </div>
                </div>
            {% endif %}
        </div>
    </header>
{% endblock %}
